#RubyRPG Project. Coded by Ruairidh Wynne-McHardy.
#Would prefer to be in bed right now or at least in the pub but instead I sacrifice endless hours 
# coding a rather odd RPG game!
#Let's create a basic class for the evil Monsters!
class Enemy
  attr_accessor :hp, :weapon, :name, :points
   def initialize(name,hp,weapon, points)
     @hp = hp
     @weapon = weapon
     @name = name
     @points = points
   end


   
   def hit(damage)
     @hp -= damage
   end

   def status
     if @hp < 25
       return "The enemy is close to death! ONWAAAARDS!."
     else
       return "The enemy is still ready to attack you. Strike it down!"
     end
   end
end
 
class Player
    attr_accessor :hp, :weapon, :name, :points
   def initialize(name,hp,weapon, points)
     @hp = hp
     @weapon = weapon
     @name = name
     @points = points
   end
   
   def hit(damage)
     @hp -= damage
   end
   
   def status
    if @hp < 25
       return "Hmm your health is looking pretty low. Maybe you should run!"
       if @hp <50
         return "Your health isn't great but you could maybe win this. Play carefully!"
       end
     else
       return "You're pretty healthy, go for it!"
     end
   end
  
   def inventory
     @inventory 
   end
   def inventory=(inventory)
     @inventory = inventory
   end
 end

#Testing shows that this works. The world is full of happiness once more!

grunt = Enemy.new("gruntyman",50,"ak47",10)
puts "............................................................"
puts "Time for some information about our basic enemy"
puts grunt.name, grunt.hp, grunt.status, grunt.weapon
play = Player.new("hero",100,"sword",0)
puts "............................................................"
puts "Time for some information about our hero"
puts play.name, play.hp, play.weapon, play.inventory = ['rice','ammo','cheese']

